package Day05;

import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score=0;
        for (int i=1;i<=10;i++){
            int a = (int)(Math.random()*10+1);
            int b = (int)(Math.random()*10+1);
            System.out.println(i+")"+a+"+"+b+"=?");
            int num=scan.nextInt();
            if (num==888){
                break;
            }
            if (num==777){
                continue;
            }
            if (num==a+b){
                System.out.println("答对了");
                score+=10;
            }else{
                System.out.println("答错了");
            }
        }System.out.println("总成绩:"+score);
    }
}
